package com.test;

import com.example.demo.model.Userinfo;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.junit.jupiter.api.Test;

import java.io.Reader;

public class test1 {

    @Test
    public void test()throws Exception{

        Reader reader = Resources.getResourceAsReader("mybatis.xml");
        SqlSessionFactory factory = new SqlSessionFactoryBuilder().build(reader);
        SqlSession session = factory.openSession();
        Object Userinfo = new Object();
        Object o = session.insert("dao.UserMapper.insertUserInfo", Userinfo);
        System.out.println(o);
        session.close();
    }

}
